<script setup>
import { RouterLink } from 'vue-router'
</script>

<template>
  <main class="home-container">
    <div class="hero-section">
      <div class="hero-content">
        <div class="hero-text">
          <h1 class="hero-title">
            <span class="title-main">易经算卦</span>
            <span class="title-sub">I Ching Divination</span>
          </h1>
          <p class="subtitle">探索古老智慧，寻求人生指引</p>
          <p class="description">通过AI智能解读，体验传统易经的现代魅力</p>
        </div>
        <div class="hero-buttons">
          <RouterLink to="/divination" class="btn btn-primary">
            <span class="btn-icon">🪙</span>
            <span class="btn-text">开始算卦</span>
          </RouterLink>
          <RouterLink to="/hexagrams" class="btn btn-secondary">
            <span class="btn-icon">📚</span>
            <span class="btn-text">浏览卦象</span>
          </RouterLink>
        </div>
      </div>
      <div class="hero-visual">
        <div class="hexagram-animation">
          <div class="hexagram-symbol">☰</div>
          <div class="floating-elements">
            <div class="element element-1">☷</div>
            <div class="element element-2">☳</div>
            <div class="element element-3">☴</div>
            <div class="element element-4">☵</div>
            <div class="element element-5">☲</div>
            <div class="element element-6">☶</div>
            <div class="element element-7">☱</div>
          </div>
        </div>
      </div>
    </div>

    <div class="features-section">
      <h2>功能特色</h2>
      <div class="features-grid">
        <div class="feature-card">
          <div class="feature-icon">🪙</div>
          <h3>三枚硬币</h3>
          <p>传统算卦方式，通过抛掷三枚硬币生成卦象，体验最正宗的易经占卜</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">🔢</div>
          <h3>数字随机</h3>
          <p>现代随机数生成方式，快速获得卦象，适合日常咨询使用</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">📚</div>
          <h3>完整64卦</h3>
          <p>包含完整的六十四卦系统，上经30卦，下经34卦，每卦都有详细的卦辞和爻辞解释</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">🤖</div>
          <h3>AI智能解读</h3>
          <p>集成先进AI技术，提供深度、个性化的卦象解读，结合传统易经智慧与现代AI分析</p>
        </div>
      </div>
    </div>

    <div class="intro-section">
      <h2>关于易经</h2>
      <div class="intro-content">
        <p>《易经》是中国古代最重要的经典之一，被誉为"群经之首，大道之源"。它通过六十四卦的符号系统，揭示了宇宙万物的变化规律和人生智慧。</p>
        <p>算卦是易经的重要应用方式，通过特定的方法生成卦象，然后根据卦辞和爻辞来解读问题，为人生决策提供参考和指导。</p>
        <p>本应用采用传统与现代相结合的方式，让您能够便捷地体验易经算卦的智慧，在人生的十字路口获得启发和指引。</p>
      </div>
    </div>
  </main>
</template>

<style scoped>
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Microsoft YaHei', sans-serif;
}

.hero-section {
  display: flex;
  align-items: center;
  min-height: 80vh;
  padding: 60px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  margin-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  flex: 1;
  z-index: 2;
  position: relative;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  position: relative;
}

.hero-title {
  margin-bottom: 30px;
}

.title-main {
  display: block;
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #fff, #f0f8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.title-sub {
  display: block;
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.8;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.4rem;
  margin-bottom: 15px;
  opacity: 0.95;
  font-weight: 500;
}

.description {
  font-size: 1.1rem;
  margin-bottom: 40px;
  opacity: 0.85;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 25px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn {
  padding: 18px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  color: #667eea;
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 35px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 35px rgba(255, 255, 255, 0.2);
}

.btn-icon {
  font-size: 1.3rem;
  transition: transform 0.3s;
}

.btn:hover .btn-icon {
  transform: scale(1.2) rotate(5deg);
}

.btn-text {
  position: relative;
  z-index: 1;
}

.features-section {
  margin-bottom: 60px;
}

.features-section h2 {
  text-align: center;
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.feature-card p {
  color: #7f8c8d;
  line-height: 1.6;
}

.intro-section {
  background: #f8f9fa;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 40px;
}

.intro-section h2 {
  color: #2c3e50;
  margin-bottom: 30px;
  font-size: 2rem;
  text-align: center;
}

.intro-content p {
  color: #34495e;
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.intro-content p:last-child {
  margin-bottom: 0;
}

/* 动画效果 */
.hexagram-animation {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hexagram-symbol {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.9);
  animation: pulse 3s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
}

.element {
  position: absolute;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  animation: float 6s ease-in-out infinite;
}

.element-1 {
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}

.element-2 {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
}

.element-3 {
  bottom: 30%;
  left: 10%;
  animation-delay: 2s;
}

.element-4 {
  bottom: 20%;
  right: 20%;
  animation-delay: 3s;
}

.element-5 {
  top: 50%;
  left: 5%;
  animation-delay: 4s;
}

.element-6 {
  top: 60%;
  right: 5%;
  animation-delay: 5s;
}

.element-7 {
  top: 40%;
  right: 30%;
  animation-delay: 2.5s;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.6;
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

/* 功能卡片增强 */
.feature-card {
  background: white;
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 3.5rem;
  margin-bottom: 25px;
  transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    min-height: 70vh;
    padding: 40px 20px;
  }

  .hero-content {
    order: 2;
  }

  .hero-visual {
    order: 1;
    margin-bottom: 30px;
  }

  .title-main {
    font-size: 2.8rem;
  }

  .title-sub {
    font-size: 1.2rem;
  }

  .hero-buttons {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .feature-card {
    padding: 30px 20px;
  }

  .hexagram-animation {
    width: 150px;
    height: 150px;
  }

  .hexagram-symbol {
    font-size: 3rem;
  }

  .element {
    font-size: 1.2rem;
  }
}
</style>
